package com.sfpay.merchant.auth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sfpay.merchant.auth.entity.system.SysMenu;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 菜单权限表 Mapper 接口
 * </p>
 *
 * @author fangchen
 * @since 2022-07-15
 */
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    List<String> selectPermsByUserId(Long userId);

    List<SysMenu> selectMenuNormalAll();

    List<SysMenu> selectMenusByUserId(Long userId);

    List<SysMenu> selectMenuAll();

    List<SysMenu> selectMenuAllByUserId(Long userId);

    List<String> selectMenuTree(Long roleId);

    /**
     * 查询系统菜单列表
     *
     * @param menu 菜单信息
     * @return 菜单列表
     */
    List<SysMenu> selectMenuList(SysMenu menu);


    List<SysMenu> selectMenuListByUserId(SysMenu menu);

    SysMenu selectMenuById(Long menuId);

    SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);

    int insertMenu(SysMenu menu);

    int selectCountMenuByParentId(Long parentId);

    int deleteMenuById(Long menuId);
}
